package arrays;

import java.util.Arrays;

public class ArrayTest1 {
    public static void main(String[] args) {
        // 返回数组内容
        int[] arr = {10, 60, 50, 40, 30};
        String[] str = {"main", "arr", "age", "byte", "boss"};
        Arrays.sort(arr);
        Arrays.sort(str);
        System.out.println(Arrays.toString(arr));
        System.out.println(Arrays.toString(str));

        // 拷贝指定范围的数组内容    包前不包后
        int[] arr2 = Arrays.copyOfRange(arr,1,4);
        System.out.println(Arrays.toString(arr2));

        // 给数组更换新的长度，空余部分默认为0
        int[] arr3 = Arrays.copyOf(arr,10);
        System.out.println(Arrays.toString(arr3));



    }
}
